package demo2;

/**
 * @Author: Lenovo
 * @Date: 2024/5/22 20:59
 * @description:
 */
public class Computer {
    public void Open(){
        System.out.println("打开电脑...");
    }
    public void Close(){
        System.out.println("关闭电脑...");
    }
    public void UseUSB(USB usb){
        usb.OpenDevice();
        if(usb instanceof Mouse){
            Mouse mouse=new Mouse();
            mouse.Click();
        } else if (usb instanceof KeyBored) {
            KeyBored keyBored=new KeyBored();
            keyBored.input();
        }
    }
}
